circular list python

39

from itertools import cycle

lst = ['a', 'b', 'c']

pool = cycle(lst)

for item in pool:
    print item

Comments

Submit
0 Comments